package com.zhaosc.shiro.service;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Set;

import com.zhaosc.shiro.model.User;

/**
 * 
 * @Description:TODO
 * @author:zhaosc
 * @time:2017年8月18日
 * @exception
 */
public interface UserService {

    /**
     * 创建用户
     * @param user
     */
    public User createUser(User user);

//    public User updateUser(User user) throws IllegalAccessException, InvocationTargetException;

    public void deleteUser(Long userId);

    /**
     * 修改密码
     * @param userId
     * @param newPassword
     * @throws InvocationTargetException 
     * @throws IllegalAccessException 
     */
 //   public void changePassword(Long userId, String newPassword) throws IllegalAccessException, InvocationTargetException;


    User findOne(Long userId);

    List<User> findAll();

    /**
     * 根据用户名查找用户
     * @param username
     * @return
     */
    public User findByUsername(String username);

    /**
     * 根据用户名查找其角色
     * @param username
     * @return
     */
    public Set<String> findRoles(String username);

    /**
     * 根据用户名查找其权限
     * @param username
     * @return
     */
    public Set<String> findPermissions(String username);

	public void updateUser(User user) throws IllegalAccessException, InvocationTargetException;

}
